package com.twu.biblioteca;

import java.util.*;

public class Book extends ReservableItem {

    private final String isbnNumber;
    private String name;
	private String author;

    public Book(String isbnNumber, String bookName, String authorName) {
		this.isbnNumber = isbnNumber;
        this.name = bookName;
		this.author = authorName;
	}

    public static Book buildBook(String isbnNumber, String bookName, String authorName) {
        Book book = new Book(isbnNumber, bookName, authorName);
        book.setCopyList(new LinkedList<Copy>());
        return book;
    }

    public String getName() {
		return name;
	}

	public String getAuthor() {
		return author;
	}

    public String getISBNNumber() {
        return isbnNumber;
    }

	@Override
	public boolean equals(Object object) {
		Book book = (Book) object;
		return (getISBNNumber().equals(book.getISBNNumber()));
	}

    public static Book getNullBook(){
        return new NullBook();
    }

	 public String toString(){
         return getName() + " by " + getAuthor() + " - " + getISBNNumber();
     }

    public boolean isNull() {
        return false;
    }
	
}
